package fr.upmc.alasca.centreCalcul.interne.machinePhysique.coeur.ports;

import fr.upmc.alasca.centreCalcul.interne.machinePhysique.coeur.Coeur;
import fr.upmc.alasca.centreCalcul.interne.machinePhysique.coeur.interfaces.CoeurClientI;
import fr.upmc.alasca.centreCalcul.objets.Requete;
import fr.upmc.components.ComponentI;
import fr.upmc.components.ComponentI.ComponentService;
import fr.upmc.components.ports.AbstractInboundPort;

public class CoeurClientInboundPort 
extends		AbstractInboundPort
implements CoeurClientI{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public CoeurClientInboundPort(
			String uri,
			ComponentI owner
			) throws Exception
	{
		super(uri, CoeurClientI.class, owner);
	}

	@Override
	public void executerRequete(final Requete requete) throws Exception {
		final Coeur c = (Coeur) this.owner;
		
		c.handleRequestAsync(
				new ComponentService<Void>() {
					@Override
					public Void call() throws Exception {
						 c.executerRequete(requete);
						 return null;
					}
				});
	}
	
	

}
